from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter()
router.register(r'categories', views.CategoryViewSet)
router.register(r'foods', views.FoodViewSet)
router.register(r'cart', views.CartItemViewSet, basename='cart')
router.register(r'addresses', views.AddressViewSet, basename='address')
router.register(r'orders', views.OrderViewSet, basename='order')

urlpatterns = [
    path('', include(router.urls)),
    path('login/wechat/', views.WeChatLoginView.as_view(), name='wechat-login'),
    path('home/data/', views.HomeDataView.as_view(), name='home-data'),
    path('agreement/<str:document_type>/', views.AgreementView.as_view(), name='agreement'),
] 